#pragma once

#include <QPainter>
#include <QPoint>

// 蛇身
class SnakeBody {
    // 类型
    public: enum Type {
        APPLE,  // 果子
        SNAKE   // 蛇
    };

    private: QPixmap* mBitmap;  // 后台缓冲位图
    private: QBrush* mBrush;    // 画刷
    private: QPainter mDrawer;  // 绘图者
    private: SnakeBody* mNext;  // 下一个蛇身
    private: QPoint mPosition;  // 位置

    public: SnakeBody(QPixmap*, QPoint*, Type);
    public: ~SnakeBody();
    public: void draw();
    public: void erase();
    public: SnakeBody* getNext();
    public: QPoint* getPosition();
    public: void setNext(SnakeBody*);
    public: void setPosition(QPoint*);
    public: void setType(Type);
};
